package com.intelligencesoft.pss.service.binding;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.intelligencesoft.pss.dao.binding.UserBindingDao;
import com.intelligencesoft.pss.entity.binding.UserBinding;
import com.intelligencesoft.pss.enums.BindingType;

@Service
public class UserBindingService {
	
	@Autowired
	private UserBindingDao userBindingDao;
	
	public void save(UserBinding userBinding){
		userBindingDao.getHibernateTemplate().save(userBinding);
	}
	
	public UserBinding findUserBindsByUserIdAndType(String userId,BindingType bindingType){
		return userBindingDao.findUserBindsByUserIdAndType(userId, bindingType);
	}
	
	public List<UserBinding> findUserBindsByUserId(String userId){
		return userBindingDao.findUserBindsByUserId(userId);
	}
	
	public void deleteById(String id){
		userBindingDao.deleteById(id);
	}
	
	public UserBinding getOne(String id){
		return userBindingDao.get(id);
	}
}
